from threading import Thread


# 通过继承的方式创建线程
class SubThread(Thread):
    def __init__(self, name):
        Thread.__init__(self)
        self.name = name

    def run(self):
        print('子线程' + self.name + '正在运行')


if __name__ == '__main__':
    print('主线程正在运行')
    lst = []
    for i in range(100):
        t = SubThread(str(i))
        lst.append(t)
    for e in lst:
        e.start()
    for e in lst:
        e.join()
    print("执行完毕")
